import { Component } from '@angular/core';
import { DataService } from './services/data.service';
import * as flatpickr from 'flatpickr';
import { zh } from "flatpickr/dist/l10n/zh.js";
@Component({
	selector: 'app-root',
	templateUrl: './app.component.html',
	styleUrls: ['./app.component.scss'],
	providers: [DataService]
})
export class AppComponent {
	constructor() { }

	ngOnInit() {

		window['$'](document).keydown(function (e) {
			if (e.keyCode == 8) {
				window['$']('.modal-backdrop').remove()
			}
			if (e.keyCode == 8 && e.target.hasAttribute("mwlFlatpickr")) {
				e.preventDefault();
			}
		});
		// 初始化日期控件
		flatpickr.localize(zh);
	}

}
